package Demon1;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemon {
    public static void main(String[] args) {
        try {
            ServerSocket server=new ServerSocket(12345);
            Socket socket=server.accept();
            InputStream in=socket.getInputStream();
            OutputStream out=socket.getOutputStream();

            InputStreamReader inr=new InputStreamReader(in,"UTF-8");

            int len;String ss="主级";

            while ((len=inr.read())!=0){
                System.out.println((char)len);
            }


        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
